package com.antovita.militarymonkey.screens;

import com.antovita.militarymonkey.MyGdxGame;
import com.antovita.militarymonkey.service.Textures;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;

public class PauseMenuScreen extends MenuScreen {
	
	private Sprite choices[];

	public PauseMenuScreen(MyGdxGame gdxGame) {
		super(gdxGame);
	}

	@Override
	public void create() {
		
		Texture.setEnforcePotImages(false);
		Textures.loadSprites("data/pause.png", 2, 2);
		TextureRegion regions[] = Textures.getTextureRegions("data/pause.png");
		choices = new Sprite[regions.length];
		for (int i = 0; i < regions.length; i++) {
			choices[i] = new Sprite(regions[i]);
			choices[i].setSize(WIDTH / 1.3f, HEIGHT / 5f);
		}
		choices[0].setPosition(WIDTH * 0.05f, HEIGHT * 0.75f); // resume
		choices[1].setPosition(WIDTH * 0.01f, HEIGHT * 0.35f); // about
		choices[2].setPosition(WIDTH * 0.2f, HEIGHT * 0.55f); // scores
		choices[3].setPosition(WIDTH * 0.2f, HEIGHT * 0.1f); // quit
	}
	
	@Override
	public void render() {
		super.render();
		batch.begin();
		for (Sprite sprite : choices) {
			sprite.draw(batch);
		}
		batch.end();
	}
	
	public Rectangle getResume() {
		return choices[0].getBoundingRectangle();
	}
	
	public Rectangle getQuit() {
		return choices[3].getBoundingRectangle();
	}
	
	public Rectangle getAbout() {
		return choices[1].getBoundingRectangle();
	}
	
	public Rectangle getScores() {
		return choices[2].getBoundingRectangle();
	}
}
